<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'table_data.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<script type="text/javascript" src="./plugin/jqueryqrcode/src/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="./bamcss/bam.css">
<script type="text/javascript">
var sousuo = "";
var pageNum=1;
$(document).ready(function(){
	ssajax();
});

function ssajax(sousuo,pageNum){
	$.ajax({
		type:"post",
		url:"<%=basePath%>state/userCase_usersListA.action",
		data:{
			pageNum:pageNum,
			pageSize:30,
			sousuo:sousuo,
		},
		dataType:"json",
		async:false,
		success:function(data){
			var obj = eval("("+data+")");
			var trs=[];  
			var tds =[];
			var trDom;
			console.log(obj);
			if(obj.code==1){
				$('#show').html("");
				for(var i=0;i<obj.users.length;i++){
					trDom = $('<tr></tr>');  
					$('<td style="width:20%;"><a id="a1" href="javascript:void(0)" onclick="ds(this)">'+obj.users[i].userid+'</a></td>').appendTo(trDom);
					$('<td style="width:20%;">'+obj.users[i].userName+'</td>').appendTo(trDom); 
					$('<td style="width:20%;">'+obj.users[i].userPhone+'</td>').appendTo(trDom); 
					$('<td style="width:20%;">'+obj.users[i].userAccount+'</td>').appendTo(trDom); 
					trs.push(trDom);
           		}
           		for(var j=0;j<trs.length;j++){  
                	$(trs[j]).appendTo($('#show'));  
           		}
           		parent.$("#span1").html(obj.logCount);
           		parent.$("#span2").html(obj.pageCount);
           		parent.$("#span3").html(pageNum);
           	}else{
           		alert("系统出错误,请联系技术人员");
           	}
		},
		error:function(msg){
	   		alert("系统出错误,请联系技术人员");
		}
	});
}

</script>

<script type="text/javascript" src="./bamjs/bam.js" charset="gbk"></script>
<style type="text/css">
.table {
	line-height: 150%;
}

.table td {
	background-color: #FFF;
}
</style>

</head>
<body>
	<table class="table" id="show">
	</table>

</body>
<script defer="defer">
	function ds(elem){
	var trelem=$(elem).parent().parent().find("td");
		$.ajax({
			type:"post",
			url:"<%=basePath%>state/userCase_userDetail.action",
			data:{
				userid:trelem.get(0).innerText,
				sousuo:sousuo,
			},
			dataType:"json",
			async:false,
			success:function(data){
			    top.window.modeldata=data;
				var obj = eval("("+data+")");
				var trs=[];  
				var tds =[];
				var trDom;
				console.log(obj);
				if(obj.code==1){
					var url = "${pageContext.request.contextPath}/bamjsp/ssidStatus/detail.jsp";
					var title = "用户详细信息";
					var divtype = "big";
					window.parent.showDiv(divtype,url,title);
	           	}else{
	           		alert("系统出错误,请联系技术人员");
	           	}
			},
			error:function(msg){
		   		alert("系统出错误,请联系技术人员");
			}
		});
	}
	// 		var pageNum = ${requestScope.pu.pageNum};
	// 		var logCount = ${requestScope.pu.logCount};
	// 		var pageCount = ${requestScope.pu.pageCount};
	// 		window.parent.fenye(logCount,pageCount,pageNum);
</script>
</html>
